package com.wfs.spring.thread;

/**
 * @Auther: wfs
 * @Date: 2019/6/4 19:10
 * @Description:
 */
public class SynchronizedObjectTwo {
    private String username="a";
    private String password="aa";

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    synchronized public void printString(){
        System.out.println("begin");
        if (Thread.currentThread().getName().equals("a")){
            System.out.println("a的线程永远suspend了！");
            Thread.currentThread().suspend();
        }
        System.out.println("end");
    }
}
